using StockholmsStad.Windows.UI.Modules.WatchList.Interfaces;
using System.Collections.ObjectModel;
using StockholmsStad.Windows.UI.Modules.WatchList.Models;
namespace StockholmsStad.Windows.UI.Modules.WatchList.Views
{
    /// <summary>
    /// Interaction logic for MinisterView.xaml
    /// </summary>
    public partial class WatchListView : IWatchListView
    {
        private readonly IWatchListService watchListService;

        public WatchListView(IWatchListService service)
        {
            InitializeComponent();

            watchListService = service;
            Loaded += WatchListView_Loaded;
        }

        private void WatchListView_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            Model = watchListService.GetMessages();
        }

        #region IWatchListView Members

        public ObservableCollection<WatchListPresentationModel> Model
        {
            get { return DataContext as ObservableCollection<WatchListPresentationModel>; }
            set { DataContext = value; }
        }

        #endregion
    }
}
